package com.koron.css2.baseConfig.mapper;

import com.koron.css2.baseConfig.bean.PenaltyStrategyBean;
import com.koron.css2.baseConfig.queryBean.PenaltyStrategyQueryBean;
import com.koron.css2.baseConfig.vo.PenaltyStrategyVO;
import com.koron.css2.baseConfig.vo.SelectVO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;



public interface PenaltyStrategyMapper {
	
	/**
	 * 查询列表
	 * 
	 * @return
	 */
	List<PenaltyStrategyVO> selectPenaltyStrategyList(PenaltyStrategyQueryBean penaltyStrategyQueryBean);
	
	/**
	 * 根据id查询
	 * @param penaltyId
	 * @return
	 */
	PenaltyStrategyBean selectPenaltyStrategyById(@Param("penaltyId") String penaltyId);

	/**
	 * 添加
	 * 
	 * @param PenaltyStrategyBean
	 * @return
	 */
	void insertPenaltyStrategy(PenaltyStrategyBean penaltyStrategyBean);
	
	/**
	 * 校验字段内容重复
	 */
	@Select("select count(*) from BASE_PENALTY_STRATEGY where ${key} = #{val}")
	Integer check(@Param("key") String key, @Param("val") String val);

	/**
	 * 校验字段内容重复-排除当前记录
	 */
	@Select("select count(*) from BASE_PENALTY_STRATEGY where ${key} = #{val} and id <> #{id}")
	Integer check2(@Param("key") String key, @Param("val") String val, @Param("id") String id);
	
	/**
	 * 修改
	 * 
	 * @param PenaltyStrategyBean
	 * @return
	 */
	Integer updatePenaltyStrategy(PenaltyStrategyBean penaltyStrategyBean);
	
	/**
	 * 查询列表
	 * @return
	 */
	List<SelectVO>  selectStrategyNameList();


}
